package Models;

import java.io.Serializable;
import java.util.List;

import utils.Calcs;

public class Recipe implements Serializable {
	private static final long serialVersionUID = 1L;
	
    private int id;// Recipes.RID
    private String name;// Recipes.RName
    private int revision;// Recipes.RRev
    private double targetGravity;// Recipes.RGT
    private double volume;// Recipes.RVol
    private Yeast yeastId;// Recipes.YeastName
    private double primaryTemp;// Recipes.PTemp
    private double ibus;// Recipes.RIBU
    private MashSchedule mashSchedule;
    private RecipeSalts recipeSalts;
    private List<MaltBill> maltBill;
    private List<BoilHops> boilHops;
    private List<DryHops> dryHops;
    private List<RecipeAdditives> spiceAndFlavors;
    private String recipeNotes;
    
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getRevision() {
		return revision;
	}
	public void setRevision(int revision) {
		this.revision = revision;
	}
	public double getTargetGravity() {
		return targetGravity;
	}
	public void setTargetGravity(double targetGravity) {
		if((targetGravity < 1.200)&&(targetGravity != 0)){
            this.targetGravity = Calcs.specificGravityToPlato(targetGravity);
        } else {
            this.targetGravity = targetGravity;
        }
	}
	public double getVolume() {
		return volume;
	}
	public void setVolume(double volume) {
		this.volume = volume;
	}
	public Yeast getYeastId() {
		return yeastId;
	}
	public void setYeastId(Yeast yeastId) {
		this.yeastId = yeastId;
	}
	public double getPrimaryTemp() {
		return primaryTemp;
	}
	public void setPrimaryTemp(double primaryTemp) {
		this.primaryTemp = primaryTemp;
	}
	public double getIbus() {
		return ibus;
	}
	public void setIbus(double ibus) {
		this.ibus = ibus;
	}
	public MashSchedule getMashSchedule() {
		return mashSchedule;
	}
	public void setMashSchedule(MashSchedule mashSchedule) {
		this.mashSchedule = mashSchedule;
	}
	public RecipeSalts getRecipeSalts() {
		return recipeSalts;
	}
	public void setRecipeSalts(RecipeSalts recipeSalts) {
		this.recipeSalts = recipeSalts;
	}
	public List<MaltBill> getMaltBill() {
		return maltBill;
	}
	public void setMaltBill(List<MaltBill> maltBill) {
		this.maltBill = maltBill;
	}
	public List<BoilHops> getBoilHops() {
		return boilHops;
	}
	public void setBoilHops(List<BoilHops> boilHops) {
		this.boilHops = boilHops;
	}
	public List<DryHops> getDryHops() {
		return dryHops;
	}
	public void setDryHops(List<DryHops> dryHops) {
		this.dryHops = dryHops;
	}
	public List<RecipeAdditives> getSpiceAndFlavors() {
		return spiceAndFlavors;
	}
	public void setSpiceAndFlavors(List<RecipeAdditives> spiceAndFlavors) {
		this.spiceAndFlavors = spiceAndFlavors;
	}
	public String getRecipeNotes() {
		return recipeNotes;
	}
	public void setRecipeNotes(String recipeNotes) {
		this.recipeNotes = recipeNotes;
	}
    
	public String getDisplayName(){
	        return this.getName() + " - Rev: " + Integer.toString(this.getRevision());
	}
	
	public String getFileDisplayName(){
	        return this.getName() + "_Rev_" + Integer.toString(this.getRevision());
	}
}
